home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WFC010.ZIP / TEST / TCNETFIL.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-23  |  1.2 KB  |  35 lines

  1. #include "test.h"
  2. #pragma hdrstop
  3.  
  4. void test_CNetworkFiles( LPCTSTR machine_name )
  5. {
  6.    CNetworkFiles network_files( machine_name );
  7.  
  8.    CNetworkFileInformation network_files_information;
  9.  
  10.    if ( network_files.Enumerate() == TRUE )
  11.    {
  12.       printf( "Network Files Information:\n" );
  13.  
  14.       while( network_files.GetNext( network_files_information ) == TRUE )
  15.       {
  16.          printf( " ID            - %d\n",               network_files_information.ID            );
  17.          printf( " PathName      - \"%s\"\n", (LPCTSTR) network_files_information.PathName      );
  18.          printf( " UserName      - \"%s\"\n", (LPCTSTR) network_files_information.UserName      );
  19.          printf( " Permissions   - %d\n",               network_files_information.Permissions   );
  20.          printf( " NumberOfLocks - %d\n",               network_files_information.NumberOfLocks );
  21.       }
  22.    }
  23.    else
  24.    {
  25.       DWORD error_code = network_files.GetErrorCode();
  26.  
  27.       CString error_message;
  28.  
  29.       Convert_NERR_Code_to_String( error_code, error_message );
  30.  
  31.       printf( "CNetworkFiles.Enumerate( CNetworkFileInformation ), ErrorCode == %d \"%s\"\n", error_code, (LPCTSTR) error_message );
  32.    }
  33. }
  34.  
  35.